package com.flexdms.i18n;

import javax.faces.context.FacesContext;
import javax.faces.context.FacesContextWrapper;

public class LocalizedFacesContext extends FacesContextWrapper
{

	FacesContext parent;
	public LocalizedFacesContext(FacesContext fc)
	{
		parent=fc;
		setCurrentInstance(this);
		// 2. put CustomFacesContext as FacesContext to ELContext
	     //getELContext().putContext(FacesContext.class, this);

	}
	@Override
	public FacesContext getWrapped()
	{
		return parent;
	}
	@Override
	public void addMessage(String clientId, javax.faces.application.FacesMessage message)
	{
		
		parent.addMessage(clientId, LocalizationHelper.processFacesMessage(message));
	}

	
}
